<?php
header("Content-Type: text/html;charset=utf-8");
$wOpt=$_GET;
//$wOpt['package'] = 'prepay_id='.$wOpt['package'];
//echo '<pre>';
//print_r($wOpt);
//var_dump("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
?>
<script type="text/javascript">
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
	WeixinJSBridge.invoke('getBrandWCPayRequest', {
		'appId' : '<?php echo $wOpt['appId'];?>',
		'timeStamp': '<?php echo $wOpt['timeStamp'];?>',
		'nonceStr' : '<?php echo $wOpt['nonceStr'];?>',
		'package' : '<?php echo $wOpt['package'];?>',
		'signType' : '<?php echo $wOpt['signType'];?>',
		'paySign' : '<?php echo $wOpt['paySign'];?>'
	}, function(res) {
		if(res.err_msg == 'get_brand_wcpay_request:ok') {
			alert('您已成功付款! ');
			window.location.href='http://wx.tingzan88.com/Client/wo/index';
		}else{
			alert('微信支付失败!');
		}
	});
}, false);
</script>